const mongoose = require('mongoose')

const Schema = mongoose.Schema

const schema = new Schema({
  value: Number,
  count: {
    type: Number,
    default: 0
  },
  total_margin_balance: {
    type: Number,
    default: 0
  },
  balance_change: {
    type: Number,
    default: 0
  },
  duo_count: {
    type: Number,
    default: 0
  },
  kong_count: {
    type: Number,
    default: 0
  },
  duo_usdt: {
    type: Number,
    default: 0
  },
  kong_usdt: {
    type: Number,
    default: 0
  },
  position_config: {
    type: Number,
    default: 0
  },
  model_str: String,
  time: String,
  detail: {
    type: Object,
    default: {}
  },
  // 创建时间
  create_at: {
    type: Date,
    default: Date.now
  }
})

schema.index({ time: 1 }, { unique: true })

module.exports = mongoose.model('QuoteVolume', schema)
